package com.inspinia.message.dao;

import com.inspinia.base.dao.BaseDao;
import com.inspinia.message.common.model.NoticePush;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

/**
 * 通知推送dao
 * Created by heshun on 2018-1-8.
 */
public interface NoticePushDao extends BaseDao<NoticePush> {

    /**
     * 批量删除通知推送
     *
     * @param ids 通知推送id数组
     */
    int batchDelete(@Param("ids") Long[] ids);

    void batchInsert(@Param("noticeId") Long id, @Param("userIds") Collection<Long> userIds, @Param("status") int status);

    int getUnreadNumber(@Param("userId") Long userId);

    int batchInsert(List<NoticePush> list);

    int setToRead(@Param("id") Long id);

    List<NoticePush> findUnread(@Param("userId") Long userId);

    List<NoticePush> findTopNUnreadNoticeId(@Param("userId") Long userId, @Param("topN") int topN);

    int batchSetToRead(@Param("ids") Long[] ids);

    void deleteDayBefore(@Param("day") int day);

    void readAll(@Param("userId") Long userId);
}